package com.he.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
@TableName("book")
public class Book {
    @TableId(type = IdType.AUTO)
    private Long id;

    private String name;

    private String type;

    private Double price;

    public Book(String name, String type){
        this.name = name;
        this.type = type;
    }

    @TableLogic
    private Integer isDeleted;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    private Integer status;

}